Field of the Invention
The present invention relates to the field of data processing and, in particular, performing tracing when handling exceptions in a data processing apparatus.
Background
Tracing is a technique used in data processing apparatus, which involves generating trace data packets that provide additional information relating to the processing activities of devices within a data processing apparatus, particularly the processing circuitry. By providing additional information on the data processing apparatus, it is possible to observe the actions taken by the data processing apparatus when carrying out tasks. Information recorded in a trace may include not only the actions taken by the data processing apparatus but also when each action was performed. If the processing apparatus behaves in an unexpected manner, it is possible for a hardware or software developer to review the trace data in order to determine the original cause of the unexpected behaviour, and to prevent it from occurring again in the future.
It is known in the field of processing devices to use exceptions to indicate that a particular event has occurred. When an exception is taken, the processing circuitry executes an exception handling routine to take some action in response to the exception. For example, an exception may be raised to indicate the availability of data from an external data device, in which case the exception handling routine may cause the processing circuitry to fetch the available data and store it in a buffer. Another example of an exception is to indicate that a fault has occurred, in which case the exception handling routine may cause the processing circuitry to attempt to recover from the fault, or to mitigate any damage caused as a result of the fault.
It is possible to use tracing to monitor the occurrence of exceptions. Typically this is done by generating a trace data packet whenever an exception is taken.